Updater Guide
This guide will help you understand the basics of the PMDCP Updater system, and shed some light on how to get it set up with your game. First things first, here’s what you’ll need before attempting to follow the steps outlined below: * A HTTP server for the storage and downloading systems of the updates themselves. * A copy of the PMDCP client source with working updater code. * A cloned (or downloaded) version of the PMDCP repository (https://github.com/pmdcp) * Microsoft Visual Studio Steps Below are the steps on getting your updater set up properly: 1. Navigate to UpdatePackages > client. Once you’re in that folder, you’ll see various other folders with names like ‘KB-A-####’. Take a brief moment of your time to read the ‘PackageInfo.txt’ file, as it explains what kind of update is contained within each folder. 2. Compile each of the update packages from the solution inside each of the folders. Make sure your build config is set to ‘Release’, as there are some post-build scripts that run automatically to set up your file structure. 3. Once that’s done, there should be 4 folders inside your original package folder; ‘KB-A-####’, ‘build’, ‘config’ and ‘files’. 4. Inside ‘config’, edit the configuration XML to the specifications of your update by giving your package a name and a brief description - these will be displayed to your players whenever they download an update. 5. Add the updated files themselves to your ‘files’ folder, following the file structure you want inside your game directory. For example, to update sprite 6 in my game, I would use the following file structure: GFX > Sprites > Sprite6.zip It is very important that you mirror the file structure of your game directory to make sure your updates are installed in the correct directory. The structure I used above would tell the updater to first find the ‘GFX’ folder, and create it if it doesn’t exist. Next, it would find the ‘Sprites’ folder, again creating it if it doesn’t exist. Finally, it would add the updated ‘Sprite6.zip’ to that folder, either replacing the old version or adding your new version in. 6. Go to your ‘build’ folder and run the ‘PackageGen.bat’ file. This will create the files you’ll need to upload to your web-server. 7. Here’s where we create the web-server file structure. It doesn’t really matter where you put the updater files as long as they’re all together, but I recommend creating a new directory dedicated for updates. 8. In your web-server, add a ‘Packages’ directory. This is where each of the updater files will go. So, let’s say I issued a graphics update using ‘KB-A-0002’. In my ‘Packages’ directory, I would create a directory named ‘KB-A-0002’ and then I would add my ‘KB-A-0002.zip’ and ‘KB-A-0002.xml’ files that we created in step 6 to the directory. 9. You’ve now uploaded your completed update package to your server. At this point, you may be wondering how exactly you can get this update out to your players. It’s fairly straightforward from this point. Navigate back out of ‘Packages’ and create a file named ‘UpdateData.xml’. A sample copy of this file is available in your ‘UpdatePackages’ folder from the PMDCP repository. Now, you simply add the new update to your ‘UpdateData.xml’ file. 10. If you’ve never used the in-game updater before, your client version will, by default, be 0. Ship the first update as version 1. For example, here’s what I would put in my ‘UpdateData.xml’ for my ‘KB-A-0002’ graphics update. KB-A-0002 1 If you would like to issue a second update to your game where players must have version 1 before they download, here’s what you’d do: KB-A-#### 2 KB-A-0002 1 Because of the newly added ‘’ tags, the updater will only download these updates after having the first one. 11. Finally, save your ‘UpdateData.xml’ file and verify that everything is working properly. If it is, congratulations! If not, try retracing your steps to see what you might’ve missed or done wrong. To get your client to actually connect to your update system, point your ‘UpdateLink’ in your ‘Settings.xml’ file to your ‘UpdateData.xml’ on your web-server. For example: http://example.com/Updates/UpdateData.xml Tips * You can modify how each update package works by editing its code in the solution. Each time you make a modification, however, be sure to build the solution before shipping your update out. * Update versions are stored in your client’s ‘Packages.dat’ file. Delete this file and your client will re-download all updates. This is very useful when testing.